package com.vcms.cms.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Model entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "model", catalog = "vcms_0.1")
public class Model implements java.io.Serializable {

	// Fields

	private Integer modelId;
	private Channel channel;
	private String modelName;
	private String modelPath;
	private String tplChannelPrefix;
	private String tplContentPrefix;
	private Integer titleImgWidth;
	private Integer titleImgHeight;
	private Integer contentImgWidth;
	private Integer contentImgHeight;
	private Integer priority;
	private Boolean hasContent;
	private Boolean isDisabled;
	private Boolean isDef;
	private Set<ModelItem> modelItems = new HashSet<ModelItem>(0);

	// Constructors

	/** default constructor */
	public Model() {
	}

	/** full constructor */
	public Model(Channel channel, String modelName, String modelPath,
			String tplChannelPrefix, String tplContentPrefix,
			Integer titleImgWidth, Integer titleImgHeight,
			Integer contentImgWidth, Integer contentImgHeight,
			Integer priority, Boolean hasContent, Boolean isDisabled,
			Boolean isDef, Set<ModelItem> modelItems) {
		this.channel = channel;
		this.modelName = modelName;
		this.modelPath = modelPath;
		this.tplChannelPrefix = tplChannelPrefix;
		this.tplContentPrefix = tplContentPrefix;
		this.titleImgWidth = titleImgWidth;
		this.titleImgHeight = titleImgHeight;
		this.contentImgWidth = contentImgWidth;
		this.contentImgHeight = contentImgHeight;
		this.priority = priority;
		this.hasContent = hasContent;
		this.isDisabled = isDisabled;
		this.isDef = isDef;
		this.modelItems = modelItems;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "modelId", unique = true, nullable = false)
	public Integer getModelId() {
		return this.modelId;
	}

	public void setModelId(Integer modelId) {
		this.modelId = modelId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "channelId")
	public Channel getChannel() {
		return this.channel;
	}

	public void setChannel(Channel channel) {
		this.channel = channel;
	}

	@Column(name = "modelName", length = 100)
	public String getModelName() {
		return this.modelName;
	}

	public void setModelName(String modelName) {
		this.modelName = modelName;
	}

	@Column(name = "modelPath", length = 300)
	public String getModelPath() {
		return this.modelPath;
	}

	public void setModelPath(String modelPath) {
		this.modelPath = modelPath;
	}

	@Column(name = "tplChannelPrefix", length = 50)
	public String getTplChannelPrefix() {
		return this.tplChannelPrefix;
	}

	public void setTplChannelPrefix(String tplChannelPrefix) {
		this.tplChannelPrefix = tplChannelPrefix;
	}

	@Column(name = "tplContentPrefix", length = 50)
	public String getTplContentPrefix() {
		return this.tplContentPrefix;
	}

	public void setTplContentPrefix(String tplContentPrefix) {
		this.tplContentPrefix = tplContentPrefix;
	}

	@Column(name = "titleImgWidth")
	public Integer getTitleImgWidth() {
		return this.titleImgWidth;
	}

	public void setTitleImgWidth(Integer titleImgWidth) {
		this.titleImgWidth = titleImgWidth;
	}

	@Column(name = "titleImgHeight")
	public Integer getTitleImgHeight() {
		return this.titleImgHeight;
	}

	public void setTitleImgHeight(Integer titleImgHeight) {
		this.titleImgHeight = titleImgHeight;
	}

	@Column(name = "contentImgWidth")
	public Integer getContentImgWidth() {
		return this.contentImgWidth;
	}

	public void setContentImgWidth(Integer contentImgWidth) {
		this.contentImgWidth = contentImgWidth;
	}

	@Column(name = "contentImgHeight")
	public Integer getContentImgHeight() {
		return this.contentImgHeight;
	}

	public void setContentImgHeight(Integer contentImgHeight) {
		this.contentImgHeight = contentImgHeight;
	}

	@Column(name = "priority")
	public Integer getPriority() {
		return this.priority;
	}

	public void setPriority(Integer priority) {
		this.priority = priority;
	}

	@Column(name = "hasContent")
	public Boolean getHasContent() {
		return this.hasContent;
	}

	public void setHasContent(Boolean hasContent) {
		this.hasContent = hasContent;
	}

	@Column(name = "isDisabled")
	public Boolean getIsDisabled() {
		return this.isDisabled;
	}

	public void setIsDisabled(Boolean isDisabled) {
		this.isDisabled = isDisabled;
	}

	@Column(name = "isDef")
	public Boolean getIsDef() {
		return this.isDef;
	}

	public void setIsDef(Boolean isDef) {
		this.isDef = isDef;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "model")
	public Set<ModelItem> getModelItems() {
		return this.modelItems;
	}

	public void setModelItems(Set<ModelItem> modelItems) {
		this.modelItems = modelItems;
	}

}